<?php
declare (strict_types = 1);
namespace app\common\middleware;
use app\common\service\AdminUser as S;

class WxCheck
{
    public function handle($request, \Closure $next)
    {
        $user_agente = $_SERVER['HTTP_USER_AGENT'];
        //判断微信
       // if (strpos($user_agente, 'MicroMessenger') == false) { echo "请在微信中使用"; die(); }
        
        if(S::isLogin() == false){
            //dump(request()->url());
           
           //return redirect($request->root().'/wx/wxlogin?rurl='.request()->url());
        }
        //(new \app\common\model\AdminAdminLog)->record();
        return $next($request);
    }
}

